/**
 * 
 */
package cn.ad.server.web.service;

/**
 * 用于系统中对应的资源没有找到时的异常
 * @author Wu Chengjun
 */
public class ResourceNotFoundException extends RuntimeException {

	/**
	 * 资源名称
	 */
	private String resourceName;
	
	/**
	 * 资源标识
	 */
	private String resourceID;
	
	/**
	 * 
	 */
	public ResourceNotFoundException() {
	}
	

	public ResourceNotFoundException(String resourceName, String resourceID) {
		super();
		this.resourceName = resourceName;
		this.resourceID = resourceID;
	}
	

	/**
	 * @param message
	 */
	public ResourceNotFoundException(String message) {
		super(message);
	}

	/**
	 * @param cause
	 */
	public ResourceNotFoundException(Throwable cause) {
		super(cause);
	}

	/**
	 * @param message
	 * @param cause
	 */
	public ResourceNotFoundException(String message, Throwable cause) {
		super(message, cause);
	}

	/**
	 * @param message
	 * @param cause
	 * @param enableSuppression
	 * @param writableStackTrace
	 */
	public ResourceNotFoundException(String message, Throwable cause, boolean enableSuppression,
			boolean writableStackTrace) {
		super(message, cause, enableSuppression, writableStackTrace);
	}


	/**
	 * @return the resourceName
	 */
	public String getResourceName() {
		return resourceName;
	}


	/**
	 * @param resourceName the resourceName to set
	 */
	public void setResourceName(String resourceName) {
		this.resourceName = resourceName;
	}


	/**
	 * @return the resourceID
	 */
	public String getResourceID() {
		return resourceID;
	}


	/**
	 * @param resourceID the resourceID to set
	 */
	public void setResourceID(String resourceID) {
		this.resourceID = resourceID;
	}


	@Override
	public String getMessage() {
		StringBuilder sb = new StringBuilder();
		sb.append("the resource about [")
		  .append(resourceName)
		  .append("]")
		  .append("is not found by resourceID[")
		  .append(resourceID)
		  .append("]");
		return sb.toString();
	}
}
